<?php

namespace app\course\validate\base;

use think\Validate;

/**
 * 课程验证
 */
class Course extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'course_id'  => 'require|number',
        'section_id' => 'require|number',
        'ware_id'    => 'require|number',
    ];

    protected $field = [
        'course_id'  => '课程ID',
        'section_id' => '课时ID',
        'ware_id'    => '课件ID',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'unlock' => ['course_id', 'section_id'],
        'ware'   => ['course_id', 'ware_id'],
    ];

}
